package com.wsoft.system.service.impl;

import cn.hutool.core.convert.Convert;
import com.wsoft.core.service.CommonPostService;
import com.wsoft.core.vo.PostVO;
import com.wsoft.system.entity.SysPostEntity;
import com.wsoft.system.service.ISysPostService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author z001
 * @Date 2024/12/31 13:11
 */
@Service
public class CommonPostServiceImpl implements CommonPostService {

    @Resource
    private ISysPostService postService;

    @Override
    public List<PostVO> getPostAll() {
        List<SysPostEntity> list = postService.listAll();
        return list.stream().map(item-> Convert.convert(PostVO.class,item)).collect(Collectors.toList());
    }
}
